﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PluginMediatorSample.Classes;

namespace PluginMediatorSample
{
    public partial class Form1 : Form
    {
        private B b;
        private C c;
        private D d;

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            // send a message to all the other VMs
            d.SendMessage1("D");
        }

        private void button2_Click(object sender, EventArgs e)
        {
            d.SendMessage2(4);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            c = null;
            GC.Collect();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            b = null;
            GC.Collect();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            b = new B();
            c = new C();
            d = new D();
        }
    }
}
